package com.practice.rpc.client;

import java.lang.reflect.Proxy;

public class RpcClientProxy {
	
	@SuppressWarnings("unchecked")
	public <T> T createProxy(final Class<T> service, final String host, final int port) {
		return (T) Proxy.newProxyInstance(service.getClassLoader(), new Class[] {service}, 
				new RemoteInvocationHandler(host, port));
	}

}
